﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace Weazel.Badger.Vhdl.Expressions
{
  public class ConstantReferenceExpression : Expression
  {
    private ConstantDeclaration constant;
    public ConstantDeclaration Constant
    {
      get
      {
        return constant;
      }

      set
      {
        constant = value;
      }
    }

    public ConstantReferenceExpression(
			IComponent parentContainer, 
			ConstantDeclaration constant
		) 
			: base(parentContainer, constant.Type, constant.GezelType)
    {
      this.constant = constant;
    }

    public override Weazel.Badger.Vhdl.Types.TypeSet GetPossibleTypes()
    {
      return constant.GetPossibleTypes();
    }

		public override void SetActualType(Entity entity, Process process, Statements.StatementCollection statements, Weazel.Badger.Vhdl.Types.Type type)
    {
			constant.SetActualType(entity, process, statements, type);
    }

    public override bool VerifyType(ref List<VerifyMessage> messages)
    {
      return constant.VerifyType(ref messages);      
    }

    public override string ToString()
    {
      return this.constant.Name;
    }
  }
}
